/**
 * Description: 友元相关的性质
 * File: friend.cpp |Time: 2022-05-15 15:59
 */

#include <iostream>

using namespace std;

class Chinese;

class Human 
{
    Human()
    {
        name    = "sons of Yan Huang";
        color   = "yellow";
    }
private:
    string name;
    string color;
/**
 * 说明: 
 * 1. 友元声明可以不加class
 * 2. 友元声明不用关心权限
 * 3. 友元可以多次声明
 */
public:
    friend Chinese;
private:
    friend Chinese;
protected:
    friend Chinese;
};


class Chinese 
{
private:
    Human h;
public:
    void say(){
        cout << "my name is: " <<  h.name << endl;
    }
};

int main(int argc, const char *argv[])
{
    Chinese bo;
    bo.say();
    return 0;
}


